package top.songxs.gmall.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import top.songxs.gmall.product.entity.SpuSaleAttr;
import top.songxs.gmall.product.service.SpuSaleAttrService;
import top.songxs.gmall.product.mapper.SpuSaleAttrMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86176
* @description 针对表【spu_sale_attr(spu销售属性)】的数据库操作Service实现
* @createDate 2023-05-15 20:14:07
*/
@Service
public class SpuSaleAttrServiceImpl extends ServiceImpl<SpuSaleAttrMapper, SpuSaleAttr>
    implements SpuSaleAttrService{

    @Autowired
    private SpuSaleAttrMapper spuSaleAttrMapper;

    @Override
    public List<SpuSaleAttr> getSpuSaleAttrListBySpuId(Long spuId) {
        //select ssa.* , ssav.id ssavId , ssav.sale_attr_value_name from spu_sale_attr ssa
        //LEFT JOIN spu_sale_attr_value ssav on ssav.spu_id = ssa.spu_id and ssav.base_sale_attr_id = ssa.base_sale_attr_id
        //where ssa.spu_id = 24 ;



        return spuSaleAttrMapper.getSpuSaleAttrListBySpuId(spuId);
    }
}




